package com.ff.neuropp.controller;


import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.ff.neuropp.domain.Resume;
import com.ff.neuropp.service.AppResumeService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping("/app/resume")
@Api(value = "app个人履历controller", tags = {"app个人履历接口"})
public class AppResumeController {

    @Autowired
    private AppResumeService appResumeService;


    @PostMapping("/add")
    @ApiOperation(value = "添加个人履历", notes = "添加个人履历")
    public Map<String,Object> add(@RequestBody Resume param){
        return appResumeService.addResume(param);
    }


    @GetMapping("/info")
    @ApiOperation(value = "查询个人履历", notes = "查询个人履历")
    public Map<String,Object> info(@ApiParam(required = true,value = "userId") @RequestParam String userId){
        return appResumeService.resumes(userId);
    }

    @PostMapping("/modify")
    @ApiOperation(value = "更改个人履历", notes = "更改个人履历")
    public Map<String,Object> update(@RequestBody Resume param){
        return appResumeService.updateResume(param);
    }

    @PostMapping("/del")
    @ApiOperation(value = "删除个人履历", notes = "删除个人履历")
    public Map<String,Object> update(@ApiParam(required = true,value = "id") @RequestParam Integer id){
        return appResumeService.delResume(id);
    }

}
